package com.fanhang.samples.springboot.data.rest.service;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

import com.fanhang.samples.springboot.data.rest.domain.Country;


@RepositoryRestResource(collectionResourceRel = "countries", path = "countries")
public interface CountryRepository extends PagingAndSortingRepository<Country, Long> {

	Page<Country> findByNameContainingAllIgnoringCase(
			@Param("name") String name, Pageable pageable);

	Country findByNameIgnoringCase(@Param("name") String name);

}
